package com.example.comsumer;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class OrderClientBackFactory implements FallbackFactory<OrderClient> {
    @Override
    public OrderClient create(Throwable throwable) {

        System.out.println(throwable.toString());

        return new OrderClient() {

            @Override
            public String findById(Long id) {
                return "OrderClientBackFactory " + id;
            }
        };
    }
}
